$(function() {
	$('#vue_vm_list').hide();
});

function roomAssetDamaged_findByTime() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list').hide();
	var startYear = $('#startYear').val();
	var startMonth = $('#startMonth').val();
	var startDay = $('#startDay').val();
	var endYear = $('#endYear').val();
	var endMonth = $('#endMonth').val();
	var endDay = $('#endDay').val();
	var startTime = getStandardDay(startYear, startMonth, startDay);
	var endTime = getStandardDay(endYear, endMonth, endDay);

	find_basic_by_json(path+'/roomAssetDamaged/findByTime',
		{startTime: startTime, endTime: endTime}, function(response) {	
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			},
			methods: {
				roomAssetDamaged_restore:function(todo) {
					if(confirm('确实要修好还原报损吗？')) {
						save_basic(path+'/roomAssetDamaged/restore', {roomAssetDamaged:todo}, function() {
							$('#'+todo.roomAssetDamagedId+'_button').remove();
							alert('修好还原成功');
						});
					}
				}
			}
		});
		
		$('#vue_vm_list').show();
	});
}
